#include<stdio.h>
int main()
{
	int other = 0;
	int space = 0;
	int letter = 0;
	int number = 0;
	 char c= getchar();
	 while (c != '\n')
	 {
		 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
		 {
			 letter++;
		 }
		 else if (c >= '0' && c <= '9')
		 {
			 number++;
		 }
		 else if (c == ' ')
			 space++;
		 else
			 other++;
		 c = getchar();
	 }
	 printf("%d %d %d %d\n", other, space, number, letter);
	return 0;
}